package com.wicket.okrbff.biz.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrbff.biz.service.StationService;
import com.wicket.okrbff.biz.service.dto.common.BffPostDto;
import com.wicket.okrbff.biz.service.dto.common.BffStationDto;
import com.wicket.okrbff.biz.service.dto.req.*;
import com.wicket.okrbff.biz.service.dto.res.*;
import com.wicket.okrbff.common.util.CommonFunctionHelper;
import com.wicket.okrbff.common.util.RedisUtil;
import com.wicket.okrframework.integration.FwBaseInductionRecordClient;
import com.wicket.okrframework.integration.FwBaseNullClient;
import com.wicket.okrframework.integration.FwBasePositionClient;
import com.wicket.okrframework.integration.FwBaseStationClient;
import com.wicket.okrframework.integration.dto.*;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.stream.Collectors;
import com.wicket.okrbff.common.exception.Assert;

/**
 * @author ：
 * @date ：
 * 
 *
 * @version 1.0
 */
@Service
public class StationServiceImpl implements StationService {
    @Resource
    FwBaseStationClient fwBaseStationClient;
    @Resource
    FwBasePositionClient fwBasePositionClient;
    @Resource
    FwBaseNullClient fwBaseNullClient;
    @Resource
    FwBaseInductionRecordClient fwBaseInductionRecordClient;
    //    @Resource
//    FwBaseStationClient fwBaseStationClient;
    @Resource
    private RedisUtil redisUtil;

    /**
   * B1-3查询岗位列表（管理）[1291]
   * gen by moon at 8/10/2022, 3:33:59 AM
   */
    @Trace(operationName = "B1-3查询岗位列表（管理）")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Override
  public BffQueryStationListRespDto queryStationList(BffQueryStationListReqDto reqDto){
      
       
       QueryStationListRespDto queryStationListRespDto_1 = null;
//步骤0: D1-3查询岗位列表 - queryStationList
     QueryStationListRespDto queryStationListRespDto = null;
    QueryStationListReqDto queryStationListReqDto=new QueryStationListReqDto();
  queryStationListReqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID//sourceId:49394_1
if(reqDto!=null){
      queryStationListReqDto.setPostId(reqDto.getPostId());//sourceId:47896_1
queryStationListReqDto.setIsArchive(reqDto.getIsArchive());//sourceId:49653_1
    }
  
    /*D1-3查询岗位列表[1491]   */
    
      queryStationListRespDto = fwBaseStationClient.queryStationList(queryStationListReqDto).getData();
      
      queryStationListRespDto_1 = queryStationListRespDto;
    
BffQueryStationListRespDto retData = new BffQueryStationListRespDto();
  if(queryStationListRespDto_1!=null){
      retData.setStationList(queryStationListRespDto_1.getStationList().stream().map(item -> BeanUtil.toBean(item, BffStationDto.class)).collect(Collectors.toList()));//sourceId:47904_1
    }
  

  retData.setPageNum(queryStationListRespDto.getPageNum());
        retData.setPageSize(queryStationListRespDto.getPageSize());
        retData.setTotal(queryStationListRespDto.getTotalNum());
        retData.setIsLastPage((Math.ceil(Double.valueOf(queryStationListRespDto.getTotalNum()) / Double.valueOf(queryStationListRespDto.getPageSize()))) <= retData.getPageNum());
        
  
return retData;
  }

    /**
   * B1-3查询编制去重岗位列表（边界）[1766]
   * gen by moon at 8/10/2022, 3:37:30 AM
   */
    @Trace(operationName = "B1-3查询编制去重岗位列表（边界）")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Override
  public BffQueryNoRepStationListRespDto queryNoRepStationList(BffQueryNoRepStationListReqDto reqDto){
      
       
       QueryNoRepStationListRespDto queryNoRepStationListRespDto_1 = null;
//步骤0: D1-3查询编制去重岗位列表 （边界） - queryNoRepStationList
     QueryNoRepStationListRespDto queryNoRepStationListRespDto = null;
    QueryNoRepStationListReqDto queryNoRepStationListReqDto=new QueryNoRepStationListReqDto();
  if(reqDto!=null){
      queryNoRepStationListReqDto.setDeptId(reqDto.getDeptId());//sourceId:53542_1
    }
  
    /*D1-3查询编制去重岗位列表 （边界）[1763]   */
    Assert.isNull(queryNoRepStationListReqDto.getDeptId(),"B1-3查询编制去重岗位列表（边界）-D1-3查询编制去重岗位列表 （边界）-部门ID不能为空",false);
      queryNoRepStationListRespDto = fwBaseStationClient.queryNoRepStationList(queryNoRepStationListReqDto).getData();
      
      queryNoRepStationListRespDto_1 = queryNoRepStationListRespDto;
    
BffQueryNoRepStationListRespDto retData = new BffQueryNoRepStationListRespDto();
  if(queryNoRepStationListRespDto_1!=null){
      retData.setStationList(queryNoRepStationListRespDto_1.getStationList().stream().map(item -> BeanUtil.toBean(item, BffStationDto.class)).collect(Collectors.toList()));//sourceId:53545_1
    }
  

  
  
return retData;
  }

    /**
   * B1-3查询可存档职位条件判断（管理）[1645]
   * gen by moon at 8/10/2022, 3:36:36 AM
   */
    @Trace(operationName = "B1-3查询可存档职位条件判断（管理）")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Override
  public BffQueryArchivePostRespDto queryArchivePost(BffQueryArchivePostReqDto reqDto){
      
       
       QueryStationListRespDto queryStationListRespDto_1 = null;
//步骤0: D1-3查询岗位列表 - queryStationList
     QueryStationListRespDto queryStationListRespDto = null;
    QueryStationListReqDto queryStationListReqDto=new QueryStationListReqDto();
  queryStationListReqDto.setSubjectLifeCycle("EDITING");//sourceId:53845_1
if(reqDto!=null){
      queryStationListReqDto.setPostId(reqDto.getPostId());//sourceId:53843_1
    }
  
    /*D1-3查询岗位列表[1491]   */
    Assert.isNull(queryStationListReqDto.getPostId(),"B1-3查询可存档职位条件判断（管理）-D1-3查询岗位列表-职位ID不能为空",false);
Assert.isNull(queryStationListReqDto.getSubjectLifeCycle(),"B1-3查询可存档职位条件判断（管理）-D1-3查询岗位列表-主体生命周期不能为空",false);
      queryStationListRespDto = fwBaseStationClient.queryStationList(queryStationListReqDto).getData();
      
      queryStationListRespDto_1 = queryStationListRespDto;
    
BffQueryArchivePostRespDto retData = new BffQueryArchivePostRespDto();
  if(queryStationListRespDto_1!=null){
      retData.setStationList(queryStationListRespDto_1.getStationList().stream().map(item->item.getStationId())
        .collect(Collectors.toList()));//sourceId:53850_1
    }
  

  
  
return retData;
  }

    /**
   * B-13新增岗位（管理）[1638]
   * gen by moon at 8/10/2022, 3:36:35 AM
   */
    @Trace(operationName = "B-13新增岗位（管理）")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Override
  public BffAddStationRespDto addStation(BffAddStationReqDto reqDto){
      
       
       AddStationRespDto addStationRespDto_1 = null;
//步骤0: D1-3新增岗位 - addStation
     AddStationRespDto addStationRespDto = null;
    AddStationReqDto addStationReqDto=new AddStationReqDto();
  if(reqDto!=null){
      addStationReqDto.setStationTypeId(reqDto.getStationTypeId());//sourceId:47729_1
addStationReqDto.setPostId(reqDto.getPostId());//sourceId:47730_1
addStationReqDto.setStationNumber(reqDto.getStationNumber());//sourceId:47731_1
addStationReqDto.setStationName(reqDto.getStationName());//sourceId:47732_1
addStationReqDto.setStationDutyDesc(reqDto.getStationDutyDesc());//sourceId:47733_1
addStationReqDto.setStationTargetDesc(reqDto.getStationTargetDesc());//sourceId:47734_1
addStationReqDto.setSubjectLifeCycle(reqDto.getSubjectLifeCycle());//sourceId:47735_1
    }
  
    /*D1-3新增岗位[1639]   */
    Assert.isNull(addStationReqDto.getStationTypeId(),"B-13新增岗位（管理）-D1-3新增岗位-岗位类型ID不能为空",false);
Assert.isNull(addStationReqDto.getStationNumber(),"B-13新增岗位（管理）-D1-3新增岗位-岗位编号不能为空",false);
Assert.isNull(addStationReqDto.getStationName(),"B-13新增岗位（管理）-D1-3新增岗位-岗位名称不能为空",false);
Assert.isNull(addStationReqDto.getSubjectLifeCycle(),"B-13新增岗位（管理）-D1-3新增岗位-主体生命周期不能为空",false);
      addStationRespDto = fwBaseStationClient.addStation(addStationReqDto).getData();
      
      addStationRespDto_1 = addStationRespDto;
    
BffAddStationRespDto retData = new BffAddStationRespDto();
  if(addStationRespDto_1!=null){
      retData.setStationId(addStationRespDto_1.getStationId());//sourceId:47736_1
    }
  

  
  
return retData;
  }

    /**
   * B1-3查询可存档岗位条件判断（管理）[1637]
   * gen by moon at 8/10/2022, 3:36:34 AM
   */
    @Trace(operationName = "B1-3查询可存档岗位条件判断（管理）")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Override
  public BffQueryArchiveStationRespDto queryArchiveStation(BffQueryArchiveStationReqDto reqDto){
      
       
       QueryPositionListRespDto queryPositionListRespDto_1 = null;
//步骤0: D1-3查询职务列表 - queryPositionList
     QueryPositionListRespDto queryPositionListRespDto = null;
    QueryPositionListReqDto queryPositionListReqDto=new QueryPositionListReqDto();
  queryPositionListReqDto.setSubjectLifeCycle("EDITING");//sourceId:53902_1
if(reqDto!=null){
      queryPositionListReqDto.setStationId(reqDto.getStationId());//sourceId:53888_1
    }
  
    /*D1-3查询职务列表[790]   */
    Assert.isNull(queryPositionListReqDto.getStationId(),"B1-3查询可存档岗位条件判断（管理）-D1-3查询职务列表-关联岗位ID不能为空",false);
Assert.isNull(queryPositionListReqDto.getSubjectLifeCycle(),"B1-3查询可存档岗位条件判断（管理）-D1-3查询职务列表-主体生命周期不能为空",false);
      queryPositionListRespDto = fwBasePositionClient.queryPositionList(queryPositionListReqDto).getData();
      
      queryPositionListRespDto_1 = queryPositionListRespDto;
    
BffQueryArchiveStationRespDto retData = new BffQueryArchiveStationRespDto();
  if(queryPositionListRespDto_1!=null){
      retData.setOrgPositionList(queryPositionListRespDto_1.getOrgPositionList().stream().map(item->item.getPositionId())
        .collect(Collectors.toList()));//sourceId:58681_1
    }
  

  
  
return retData;
  }

    /**
   * B1-3查询岗位列表（边界）[1424]
   * gen by moon at 8/10/2022, 3:35:29 AM
   */
    @Trace(operationName = "B1-3查询岗位列表（边界）")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Override
  public BffQueryStationListBorderRespDto queryStationListBorder(BffQueryStationListBorderReqDto reqDto){
      
       
       QueryStationListBorderRespDto queryStationListBorderRespDto_1 = null;
//步骤0: D1-3查询岗位列表(边界) - queryStationListBorder
     QueryStationListBorderRespDto queryStationListBorderRespDto = null;
    QueryStationListBorderReqDto queryStationListBorderReqDto=new QueryStationListBorderReqDto();
  if(reqDto!=null){
      queryStationListBorderReqDto.setPostId(reqDto.getPostId());//sourceId:49360_1
queryStationListBorderReqDto.setStationTypeId(reqDto.getStationTypeId());//sourceId:49361_1
    }
  
    /*D1-3查询岗位列表(边界)[1662]   */
    
      queryStationListBorderRespDto = fwBaseStationClient.queryStationListBorder(queryStationListBorderReqDto).getData();
      
      queryStationListBorderRespDto_1 = queryStationListBorderRespDto;
    
BffQueryStationListBorderRespDto retData = new BffQueryStationListBorderRespDto();
  if(queryStationListBorderRespDto_1!=null){
      retData.setStationList(queryStationListBorderRespDto_1.getStationList().stream().map(item -> BeanUtil.toBean(item, BffStationDto.class)).collect(Collectors.toList()));//sourceId:49369_1
    }
  

  
  
return retData;
  }

    /**
   * B1-3修改职位（管理）[1322]
   * gen by moon at 8/10/2022, 3:34:19 AM
   */
    @Trace(operationName = "B1-3修改职位（管理）")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Override
  public BffUpdatePostRespDto updatePost(BffUpdatePostReqDto reqDto){
      
       
       //步骤0: D1-3修改职位 - updatePost
     UpdatePostRespDto updatePostRespDto = null;
    UpdatePostReqDto updatePostReqDto=new UpdatePostReqDto();
  if(reqDto!=null){
      updatePostReqDto.setPostId(reqDto.getPostId());//sourceId:47552_1
updatePostReqDto.setPostNumber(reqDto.getPostNumber());//sourceId:47553_1
updatePostReqDto.setPostName(reqDto.getPostName());//sourceId:47554_1
updatePostReqDto.setSubjectLifeCycle(reqDto.getSubjectLifeCycle());//sourceId:47555_1
    }
  
    /*D1-3修改职位[1636]   */
    Assert.isNull(updatePostReqDto.getPostId(),"B1-3修改职位（管理）-D1-3修改职位-职位ID不能为空",false);
      updatePostRespDto = fwBaseStationClient.updatePost(updatePostReqDto).getData();
      
      
    
BffUpdatePostRespDto retData = new BffUpdatePostRespDto();
  
  

  
  
return retData;
  }

    /**
   * B1-3新增职位（管理）[1320]
   * gen by moon at 8/10/2022, 3:34:18 AM
   */
    @Trace(operationName = "B1-3新增职位（管理）")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Override
  public BffAddPostRespDto addPost(BffAddPostReqDto reqDto){
      
       
       AddPostRespDto addPostRespDto_1 = null;
//步骤0: D1-3新增职位 - addPost
     AddPostRespDto addPostRespDto = null;
    AddPostReqDto addPostReqDto=new AddPostReqDto();
  if(reqDto!=null){
      addPostReqDto.setPostNumber(reqDto.getPostNumber());//sourceId:47520_1
addPostReqDto.setPostName(reqDto.getPostName());//sourceId:47521_1
addPostReqDto.setSubjectLifeCycle(reqDto.getSubjectLifeCycle());//sourceId:47522_1
    }
  
    /*D1-3新增职位[1635]   */
    Assert.isNull(addPostReqDto.getPostNumber(),"B1-3新增职位（管理）-D1-3新增职位-职位编号不能为空",false);
Assert.isNull(addPostReqDto.getPostName(),"B1-3新增职位（管理）-D1-3新增职位-职位名称不能为空",false);
Assert.isNull(addPostReqDto.getSubjectLifeCycle(),"B1-3新增职位（管理）-D1-3新增职位-主体生命周期不能为空",false);
      addPostRespDto = fwBaseStationClient.addPost(addPostReqDto).getData();
      
      addPostRespDto_1 = addPostRespDto;
    
BffAddPostRespDto retData = new BffAddPostRespDto();
  if(addPostRespDto_1!=null){
      retData.setPostId(addPostRespDto_1.getPostId());//sourceId:47526_1
    }
  

  
  
return retData;
  }

    /**
   * B1-3查询职位详情（管理）[1317]
   * gen by moon at 8/10/2022, 3:34:16 AM
   */
    @Trace(operationName = "B1-3查询职位详情（管理）")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Override
  public BffQueryPostDetailRespDto queryPostDetail(BffQueryPostDetailReqDto reqDto){
      
       
       QueryPostDetailRespDto queryPostDetailRespDto_1 = null;
QueryInductionRecordInfoDetailComRespDto queryInductionRecordInfoDetailComRespDto_1 = null;
//步骤0: D1-3查询职位详情	 - queryPostDetail
     QueryPostDetailRespDto queryPostDetailRespDto = null;
    QueryPostDetailReqDto queryPostDetailReqDto=new QueryPostDetailReqDto();
  if(reqDto!=null){
      queryPostDetailReqDto.setPostId(reqDto.getPostId());//sourceId:47594_1
    }
  
    /*D1-3查询职位详情	[981]   */
    Assert.isNull(queryPostDetailReqDto.getPostId(),"B1-3查询职位详情（管理）-D1-3查询职位详情	-职位ID不能为空",false);
      queryPostDetailRespDto = fwBaseNullClient.queryPostDetail(queryPostDetailReqDto).getData();
      
      queryPostDetailRespDto_1 = queryPostDetailRespDto;
    
//步骤1: D1-3查询个人就职记录信息详情（公共） - queryInductionRecordInfoDetailCom
     QueryInductionRecordInfoDetailComRespDto queryInductionRecordInfoDetailComRespDto = null;
    if(queryPostDetailRespDto !=null){
          QueryInductionRecordInfoDetailComReqDto queryInductionRecordInfoDetailComReqDto=new QueryInductionRecordInfoDetailComReqDto();
  if(queryPostDetailRespDto!=null){
      queryInductionRecordInfoDetailComReqDto.setInductionRecordId(queryPostDetailRespDto.getOperationInductionId());//sourceId:47608_1
    }
  
    /*D1-3查询个人就职记录信息详情（公共）[715]   */
    Assert.isNull(queryInductionRecordInfoDetailComReqDto.getInductionRecordId(),"B1-3查询职位详情（管理）-D1-3查询个人就职记录信息详情（公共）-就职记录ID不能为空",false);
      queryInductionRecordInfoDetailComRespDto = fwBaseInductionRecordClient.queryInductionRecordInfoDetailCom(queryInductionRecordInfoDetailComReqDto).getData();
      
      queryInductionRecordInfoDetailComRespDto_1 = queryInductionRecordInfoDetailComRespDto;
           }
    
BffQueryPostDetailRespDto retData = new BffQueryPostDetailRespDto();
  if(queryPostDetailRespDto_1!=null){
      retData.setPostId(queryPostDetailRespDto_1.getPostId());//sourceId:47602_1
retData.setPostNumber(queryPostDetailRespDto_1.getPostNumber());//sourceId:47603_1
retData.setPostName(queryPostDetailRespDto_1.getPostName());//sourceId:47604_1
retData.setSubjectLifeCycle(queryPostDetailRespDto_1.getSubjectLifeCycle());//sourceId:47605_1
retData.setOperationInductionId(queryPostDetailRespDto_1.getOperationInductionId());//sourceId:47606_1
retData.setOperateTime(queryPostDetailRespDto_1.getOperateTime());//sourceId:47607_1
    }
if(queryInductionRecordInfoDetailComRespDto_1!=null){
      retData.setIdCardName(queryInductionRecordInfoDetailComRespDto_1.getIdCardName());//sourceId:47614_1
retData.setNickName(queryInductionRecordInfoDetailComRespDto_1.getNickName());//sourceId:47615_1
retData.setUserFace(queryInductionRecordInfoDetailComRespDto_1.getUserFace());//sourceId:47616_1
    }
  

  
  
return retData;
  }

    /**
   * B1-3查询职位列表（管理）[1316]
   * gen by moon at 8/10/2022, 3:34:15 AM
   */
    @Trace(operationName = "B1-3查询职位列表（管理）")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Override
  public BffQueryPostListRespDto queryPostList(BffQueryPostListReqDto reqDto){
      
       
       QueryPostListRespDto queryPostListRespDto_1 = null;
//步骤0: D1-3查询职位列表 - queryPostList
     QueryPostListRespDto queryPostListRespDto = null;
    QueryPostListReqDto queryPostListReqDto=new QueryPostListReqDto();
  if(reqDto!=null){
      queryPostListReqDto.setIsArchive(reqDto.getIsArchive());//sourceId:47575_1
    }
  
    /*D1-3查询职位列表[957]   */
    Assert.isNull(queryPostListReqDto.getIsArchive(),"B1-3查询职位列表（管理）-D1-3查询职位列表-是否存档不能为空",false);
      queryPostListRespDto = fwBaseStationClient.queryPostList(queryPostListReqDto).getData();
      
      queryPostListRespDto_1 = queryPostListRespDto;
    
BffQueryPostListRespDto retData = new BffQueryPostListRespDto();
  if(queryPostListRespDto_1!=null){
      retData.setPostList(queryPostListRespDto_1.getPostList().stream().map(item -> BeanUtil.toBean(item, BffPostDto.class)).collect(Collectors.toList()));//sourceId:47578_1
    }
  

  retData.setPageNum(queryPostListRespDto.getPageNum());
        retData.setPageSize(queryPostListRespDto.getPageSize());
        retData.setTotal(queryPostListRespDto.getTotalNum());
        retData.setIsLastPage((Math.ceil(Double.valueOf(queryPostListRespDto.getTotalNum()) / Double.valueOf(queryPostListRespDto.getPageSize()))) <= retData.getPageNum());
        
  
return retData;
  }

    /**
     * B1-3存档岗位（管理）[1314]
     */
    @Trace(operationName = "B1-3存档岗位（管理）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffArchiveStationRespDto archiveStation(BffArchiveStationReqDto reqDto) {


        //步骤0: D1-3存档岗位 - archiveStation
        ArchiveStationRespDto archiveStationRespDto = null;
        ArchiveStationReqDto archiveStationReqDto = new ArchiveStationReqDto();
        if (reqDto != null) {
            archiveStationReqDto.setStationId(reqDto.getStationId());//sourceId:49364_1
        }

        /*D1-3存档岗位[1660]   */
        archiveStationRespDto = fwBaseStationClient.archiveStation(archiveStationReqDto).getData();


        BffArchiveStationRespDto retData = new BffArchiveStationRespDto();


        return retData;
    }

    /**
   * B1-3查询职位列表（边界）[1309]
   * gen by moon at 8/10/2022, 3:34:14 AM
   */
    @Trace(operationName = "B1-3查询职位列表（边界）")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Override
  public BffQueryPostListBorderRespDto queryPostListBorder(BffQueryPostListBorderReqDto reqDto){
      
       
       QueryPostListBorderRespDto queryPostListBorderRespDto_1 = null;
//步骤0: D1-3查询职位列表（边界） - queryPostListBorder
     QueryPostListBorderRespDto queryPostListBorderRespDto = null;
    QueryPostListBorderReqDto queryPostListBorderReqDto=new QueryPostListBorderReqDto();
  queryPostListBorderReqDto.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:49636_1
queryPostListBorderReqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID//sourceId:49637_1
  
    /*D1-3查询职位列表（边界）[1661]   */
    Assert.isNull(queryPostListBorderReqDto.getSubjectLifeCycle(),"B1-3查询职位列表（边界）-D1-3查询职位列表（边界）-主体生命周期不能为空",false);
Assert.isNull(queryPostListBorderReqDto.getSpaceId(),"B1-3查询职位列表（边界）-D1-3查询职位列表（边界）-创建于空间ID不能为空",false);
      queryPostListBorderRespDto = fwBaseStationClient.queryPostListBorder(queryPostListBorderReqDto).getData();
      
      queryPostListBorderRespDto_1 = queryPostListBorderRespDto;
    
BffQueryPostListBorderRespDto retData = new BffQueryPostListBorderRespDto();
  if(queryPostListBorderRespDto_1!=null){
      retData.setPostList(queryPostListBorderRespDto_1.getPostList().stream().map(item -> BeanUtil.toBean(item, BffPostDto.class)).collect(Collectors.toList()));//sourceId:49633_1
    }
  

  
  
return retData;
  }

    /**
   * B1-3修改岗位（管理）[1304]
   * gen by moon at 8/10/2022, 3:34:08 AM
   */
    @Trace(operationName = "B1-3修改岗位（管理）")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Override
  public BffUpdateStationRespDto updateStation(BffUpdateStationReqDto reqDto){
      
       
       //步骤0: D1-3修改岗位 - updateStation
     UpdateStationRespDto updateStationRespDto = null;
    UpdateStationReqDto updateStationReqDto=new UpdateStationReqDto();
  if(reqDto!=null){
      updateStationReqDto.setStationId(reqDto.getStationId());//sourceId:47833_1
updateStationReqDto.setStationTypeId(reqDto.getStationTypeId());//sourceId:47834_1
updateStationReqDto.setPostId(reqDto.getPostId());//sourceId:47835_1
updateStationReqDto.setStationNumber(reqDto.getStationNumber());//sourceId:47836_1
updateStationReqDto.setStationName(reqDto.getStationName());//sourceId:47837_1
updateStationReqDto.setStationDutyDesc(reqDto.getStationDutyDesc());//sourceId:47838_1
updateStationReqDto.setStationTargetDesc(reqDto.getStationTargetDesc());//sourceId:47839_1
updateStationReqDto.setSubjectLifeCycle(reqDto.getSubjectLifeCycle());//sourceId:47840_1
    }
  
    /*D1-3修改岗位[1642]   */
    Assert.isNull(updateStationReqDto.getStationId(),"B1-3修改岗位（管理）-D1-3修改岗位-岗位ID不能为空",false);
      updateStationRespDto = fwBaseStationClient.updateStation(updateStationReqDto).getData();
      
      
    
BffUpdateStationRespDto retData = new BffUpdateStationRespDto();
  
  

  
  
return retData;
  }

    /**
   * B1-3查询岗位详情（管理）[1302]
   * gen by moon at 8/10/2022, 3:34:07 AM
   */
    @Trace(operationName = "B1-3查询岗位详情（管理）")
    @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Override
  public BffQueryStationDetailRespDto queryStationDetail(BffQueryStationDetailReqDto reqDto){
      
       
       QueryStationDetailRespDto queryStationDetailRespDto_1 = null;
QueryInductionRecordInfoDetailComRespDto queryInductionRecordInfoDetailComRespDto_1 = null;
//步骤0: D1-3查询岗位详情 - queryStationDetail
     QueryStationDetailRespDto queryStationDetailRespDto = null;
    QueryStationDetailReqDto queryStationDetailReqDto=new QueryStationDetailReqDto();
  if(reqDto!=null){
      queryStationDetailReqDto.setStationId(reqDto.getStationId());//sourceId:47926_1
    }
  
    /*D1-3查询岗位详情[956]   */
    Assert.isNull(queryStationDetailReqDto.getStationId(),"B1-3查询岗位详情（管理）-D1-3查询岗位详情-岗位ID不能为空",false);
      queryStationDetailRespDto = fwBaseStationClient.queryStationDetail(queryStationDetailReqDto).getData();
      
      queryStationDetailRespDto_1 = queryStationDetailRespDto;
    
//步骤1: D1-3查询个人就职记录信息详情（公共） - queryInductionRecordInfoDetailCom
     QueryInductionRecordInfoDetailComRespDto queryInductionRecordInfoDetailComRespDto = null;
    if(queryStationDetailRespDto !=null){
          QueryInductionRecordInfoDetailComReqDto queryInductionRecordInfoDetailComReqDto=new QueryInductionRecordInfoDetailComReqDto();
  if(queryStationDetailRespDto!=null){
      queryInductionRecordInfoDetailComReqDto.setInductionRecordId(queryStationDetailRespDto.getOperationInductionId());//sourceId:48081_1
    }
  
    /*D1-3查询个人就职记录信息详情（公共）[715]   */
    Assert.isNull(queryInductionRecordInfoDetailComReqDto.getInductionRecordId(),"B1-3查询岗位详情（管理）-D1-3查询个人就职记录信息详情（公共）-就职记录ID不能为空",false);
      queryInductionRecordInfoDetailComRespDto = fwBaseInductionRecordClient.queryInductionRecordInfoDetailCom(queryInductionRecordInfoDetailComReqDto).getData();
      
      queryInductionRecordInfoDetailComRespDto_1 = queryInductionRecordInfoDetailComRespDto;
           }
    
BffQueryStationDetailRespDto retData = new BffQueryStationDetailRespDto();
  if(queryStationDetailRespDto_1!=null){
      retData.setStationId(queryStationDetailRespDto_1.getStationId());//sourceId:48070_1
retData.setStationNumber(queryStationDetailRespDto_1.getStationNumber());//sourceId:48071_1
retData.setStationName(queryStationDetailRespDto_1.getStationName());//sourceId:48072_1
retData.setStationDutyDesc(queryStationDetailRespDto_1.getStationDutyDesc());//sourceId:48073_1
retData.setStationTargetDesc(queryStationDetailRespDto_1.getStationTargetDesc());//sourceId:48074_1
retData.setOperationInductionId(queryStationDetailRespDto_1.getOperationInductionId());//sourceId:48075_1
retData.setOperateTime(queryStationDetailRespDto_1.getOperateTime());//sourceId:48076_1
retData.setPostId(queryStationDetailRespDto_1.getPostId());//sourceId:48077_1
retData.setPostName(queryStationDetailRespDto_1.getPostName());//sourceId:48078_1
retData.setStationTypeId(queryStationDetailRespDto_1.getStationTypeId());//sourceId:48079_1
retData.setStationTypeName(queryStationDetailRespDto_1.getStationTypeName());//sourceId:48080_1
retData.setSubjectLifeCycle(queryStationDetailRespDto_1.getSubjectLifeCycle());//sourceId:53908_1
    }
if(queryInductionRecordInfoDetailComRespDto_1!=null){
      retData.setUserId(queryInductionRecordInfoDetailComRespDto_1.getUserId());//sourceId:48087_1
retData.setIdCardName(queryInductionRecordInfoDetailComRespDto_1.getIdCardName());//sourceId:48088_1
retData.setNickName(queryInductionRecordInfoDetailComRespDto_1.getNickName());//sourceId:48089_1
retData.setUserFace(queryInductionRecordInfoDetailComRespDto_1.getUserFace());//sourceId:48090_1
    }
  

  
  
return retData;
  }
    //
}
